#include <iostream>

#if 0
template<typename T>
class TemplateSingleton
{
public:
    static T * GetInstance()
    {
        static T instance;
        return & instance;
    }
};

//CRPT 奇异递归
class Student:public TemplateSingleton<Student>
{

};
class Person:public TemplateSingleton<Person>
{

};

int main()
{
    Student::GetInstance();
    Person::GetInstance();
    return 0;
}
#endif

template<typename T>
class Base
{
public:
    void show()
    {
        ((T*)this)->show();
    }

};
class Drived:public Base<Drived>
{
public:
    void show()
    {
        std::cout<<"Derived"<<std::endl;
    }
};

int main()
{
    Base<Drived> * b = new Drived;
    b->show();
    return 0;
}